package com.my.url;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

/**
 * @author: marshal
 * @date: 2021-12-30 1:50 PM
 */
public class UrlReader {
    public static void main(String[] args) throws Exception{
        URL oracle = new URL("https://www.baidu.com/");
        BufferedReader in = new BufferedReader(
                new InputStreamReader(oracle.openStream()));

        String inputLine;
        while ((inputLine = in.readLine()) != null) {
            System.out.println(inputLine);
        }
        in.close();
    }
}
